<template>
	<navbar title="邀请代理" :isBack="true"></navbar>
	<view style="width:100%;height: 100vh;background-color: #F9F9F9;padding: 30rpx;">
		<view class=""  style="background-color: white;padding: 30rpx;">
			<view class="" style="font-size: 30rpx;font-weight: bold;background-color: white;border-radius: 10rpx;">
				请填写个人信息
			</view>
			<u-form :model="form" ref="form1" label-width="180">
				<u-form-item label="姓名" prop="name">
					<u-input v-model="form.name" placeholder="请输入姓名" />
				</u-form-item>
				<u-form-item label="身份证号" prop="id_card">
					<u-input v-model="form.id_card" placeholder="请输入身份证号" />
				</u-form-item>
			</u-form>
		</view>
		<view class="" @tap="sumbit" style="margin-top: 300rpx;width: 100%;height: 98rpx;border-radius: 110rpx;background-color: #405EEC;color: white;display: flex;justify-content: center;align-items: center;font-size: 32rpx;">
			提交
		</view>
	</view>
</template>

<script setup lang="ts">
	import {
		onLoad,
		onShareAppMessage,
		onShareTimeline,
		onReachBottom
	} from '@dcloudio/uni-app'
	import {
		reactive,
		ref
	} from 'vue'
	import tools from '@/utils/tools'
	import {
		agentDo
	} from '@/service/api/index'
	onLoad((opt)=>{
		if(opt.fid){
			form.fid = opt.fid;
		}
	})
	const form = reactive({
		name: "",
		id_card: "",
		fid:"1"
	})
	const sumbit = async () => {
		const res = await agentDo(form);
		if (res.code == 1) {
			tools.navTo('/pages/home/index',3)
		}
		tools.showToast(res.msg);
	}
</script>

<style scoped lang="scss">
</style>